import 'key_value_model.dart';

class KeyValueDataModel {
  String? key;

  String? value;

  int? id;

  List<KeyValueModel>? data;

  KeyValueDataModel({
    this.key,
    this.value,
    this.id,
    this.data,
  });

  KeyValueDataModel.fromJson(dynamic json) {
    key = json['key'];
    value = json['value'];
    id = json['id'];
    if (json['data'] != null) {
      data = [];
      json['data'].forEach((v) {
        data?.add(KeyValueModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['key'] = key;
    map['value'] = value;
    map['id'] = id;
    map['data'] = data?.map((e) => e.toJson()).toList();
    return map;
  }
}
